[Perl] Append a text File inside a Zip

Posted by aleroot on Stack Overflow See other posts from Stack Overflow or by aleroot
Published on 2010-06-01T20:59:39Z Indexed on 2010/06/01 21:03 UTC
Read the original article Hit count: 161

Filed under:

i have zip file inside a Text file (file.txt inside a file.zip) and i would have to append to this file another text file file.txt outside the zip file. How Can i do ? Is there a solution ?

I've tried to add Append =>1 parameters to IO::Compress::Zip but the file inside the zip been overwritten ..

use IO::Compress::Zip qw(zip $ZipError) ;

$filenameToZip = 'file.txt';
zip $filenameToZip => "file.zip",Append => 1
    or die "zip failed: $ZipError\n";

Need i to decompress the zip, append/merge the two TXT file's and compress the file Again ? Or Is There a better Solution ?

© Stack Overflow or respective owner

Related posts about perl